package com.example.myapplication7;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.content.IntentFilter;
import android.net.Uri;
import android.os.Bundle;
import android.provider.MediaStore;
import android.view.View;
import android.widget.Button;

import java.util.zip.Inflater;

public class MainActivity2 extends AppCompatActivity {
    String TAG = "com.example.myapplication7.MainActivity2";
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main2);
        MyReceiver myReceiver=new MyReceiver();
        IntentFilter intentFilter=new IntentFilter();
        intentFilter.addAction(TAG);
        registerReceiver(myReceiver,intentFilter);
    }

    public void openCamera(View view) {
        Intent intent=new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
        startActivity(intent);
    }

    public void openSend(View view) {
        Intent intent=new Intent(Intent.ACTION_SENDTO, Uri.parse("smsto:10086"));
        startActivity(intent);
    }

    public void sendBroadcast(View view) {
        Intent intent=new Intent(TAG);
        intent.setAction(TAG);
        sendBroadcast(intent);
    }
}